package com.itheima.day04;

import java.util.Arrays;
import java.util.Scanner;

public class Practice {
    public static void main(String[] args) {
        double[] arr1 = {12.5, 23.2, 43.5, 66.6, 55.2, 76.3, 4.5};
        Scanner sc = new Scanner(System.in);
        System.out.println("请您输入商品的价格：");
        double money = sc.nextDouble();
        double arr2[] = new double[arr1.length + 1];
        System.arraycopy(arr1, 0, arr2, 0, arr1.length);//arr1.length 是属性，不是方法。是拷贝几个，不是索引。
        arr2[arr1.length] = money;
        Arrays.sort(arr2);
        System.out.println(Arrays.toString(arr2));


    }
}
